/**
 * @func 用filter实现数组去重
 * @author wsq
 * @date 2022-5-7
 */

const spread = [12,5,8,8,130,44,130];
const uniqueArr = spread.filter((item,index,arr) =>{
    // console.log(item,index,arr);
    // 重复项就false
    return arr.indexOf(item) == index;
})
console.log(uniqueArr);

// 用Set实现
let set =new Set(spread)
const arr = [...set];
console.log(Object.prototype.toString.call(set),arr);